package com.wmd.validation.annotation;



import com.wmd.validation.enums.ConditionValidType;
import com.wmd.validation.validations.ConditionValidator;

import javax.validation.Constraint;
import javax.validation.Payload;
import java.lang.annotation.*;

/**
 * 类说明
 * 
 * @author yincheng lu
 * @time 2019年1月11日上午11:01:30
 * @Description
 */
@Target({ ElementType.TYPE })
@Retention(RetentionPolicy.RUNTIME)
@Constraint(validatedBy = ConditionValidator.class)
public @interface ConditionValid {
	String message() default "格式错误";
	
	String value();
	
	String[] fieldValue() default {};
	
	String[] fields();
	
	String[] fieldsValues() default {};
	
	ConditionValidType conditionValidType() default ConditionValidType.NOT_NULL;
	
	Class<?>[] groups() default {};

	Class<? extends Payload>[] payload() default {};

	@Target({ ElementType.TYPE })
	@Retention(RetentionPolicy.RUNTIME)
	@Documented
	@interface List {
		ConditionValid[] value();
	}
}
